import scala.beans.BeanProperty
class Teacher{
  @BeanProperty var name :String = _

}


object GetterAndSetter {
  def main(args: Array[String]): Unit = {
    val teacher = new Teacher
    //teacher.name_= "zhangs"
    teacher.name = "lisi"
    teacher.setName("lisi")
  }

}

class Dog{

  private var _leg = 0

  def leg = _leg

  def leg_=(newLeg : Int)={
    _leg = newLeg
  }

}


